function VideoWindow(_config, _path) {
	if (_path == undefined || _path == null) {
		_path = '';
	}
	var that = this;
	this.el = {}; //指代最终生成的div
	this.focus = {}; //落焦的div,也可以是焦点元素
	this.type = ''; //mediaplayer对象的类型（PIP)
	this.muteFlag = 0; //静音标志
	this.instanceId = ''; //mediaplayer对象ID
	if (_config != null || _config != undefined) {
		this.data = _config;
		if (Object.getOwnPropertyNames(_config).indexOf('type') != -1) {
			this.type = _config.type;
		}
	} else
		this.data = {}; //数据 为方便大家进行数据使用，将数据都放在data对象里。字段内容可以自己定义
	this.initial = function () {
		if (that.type == 'PIP') {
			that.instance = new MediaPlayer('PIP')
		} else {
			that.instance = new MediaPlayer()
		}
		that.instanceId = that.instance.getNativePlayerInstanceID();
		try {
			if (that.data.area != undefined) {
				if (Object.getOwnPropertyNames(that.data.area).length == 4) {
					that.playListFlag = 0; //0 单媒体播放模式 1 播放列表模式
					if (that.type == 'PIP' || that.type == 'WINDOW') {
						that.videoDisplayMode =
							0; //0 按照setVideoDisplayArea()中设置的hwlt属性显示视频 1 全屏显示 2 按宽度显示（保持比例） 3 按高度显示 255 隐藏视频窗播放声音
					} else {
						that.videoDisplayMode = 1;
					}
					that.muteFlag = 0; //0 默认有声 1 静音
					that.useNativeUIFlag = 0; //0 不使用本地UI 1 使用本地UI
					that.subtitleFlag = 0; //0 默认无字幕 1 显示字幕
					that.videoAlpha = 0; //0 完全显示 100 完全透明
					that.cycleFlag = 0; //0 循环播放 1 单次播放
					that.randomFlag = 0;
					that.instance.initMediaPlayer(that.instanceId, that.playListFlag, that.videoDisplayMode, parseInt(that.data.area.height), parseInt(that.data.area.width), parseInt(that.data.area.left), parseInt(that.data.area.top), that.muteFlag, that.useNativeUIFlag, that.subtitleFlag, that.videoAlpha, that.cycleFlag, that.randomFlag, 0);
					that.instance.setMuteUIFlag(0);
					that.instance.setAudioVolumeUIFlag(0);
					that.instance.setProgressBarUIFlag(0);
					that.instance.setAudioTrackUIFlag(0); //音轨选择UI
					that.instance.setChannelNoUIFlag(0); //频道号UI
					that.instance.setAllowTrickmodeFlag(0); //允许TrickMode操作
					that.instance.refreshVideoDisplay(); //调整视频显示，需要上面两函数配合
				} else {
					console.log('area参数错误')
				}
			}
		} catch (err) {}

	}; //创建对象
	this.update = function (_area) {
		this.data.area = _area;
		try {
			this.instance.setVideoDisplayArea(_area.left, _area.top, _area.width, _area.height);
			this.instance.refreshVideoDisplay();
		} catch (err) {
			console.log('area参数错误')
		}
		this.instance.refreshVideoDisplay();
	}; //刷新对象
	this.destroy = function () {
		this.instance.stop();
		this.instance.releaseMediaPlayer(this.instanceId)
	}; //删除对象

	this.playVideo = function (_playUrl, _time) {
		if (_time == null) {
			_time = 0;
		}
		var mediaStr = '[{mediaUrl:"' + _playUrl + '",';
		mediaStr += 'mediaCode: "jsoncode1",';
		mediaStr += 'mediaType:2,';
		mediaStr += 'audioType:1,';
		mediaStr += 'videoType:1,';
		mediaStr += 'streamType:1,';
		mediaStr += 'drmType:1,';
		mediaStr += 'fingerPrint:0,';
		mediaStr += 'copyProtection:1,';
		mediaStr += 'allowTrickmode:1,';
		mediaStr += 'startTime:0,';
		mediaStr += 'endTime:20000,';
		mediaStr += 'entryID:"jsonentry1"}]';
		that.instance.setSingleMedia(mediaStr);
		that.instance.playByTime(1, String(_time));
	}
	this.getPlayUrlById = function (_vodid) {
		var url = _path + "datajsp/play_getVodPlayUrl.jsp?PROGID=" + _vodid + "&PLAYTYPE=1&CONTENTTYPE=10&BUSINESSTYPE=1";
		return new Promise(function (resolve, reject) {
			$.get(url, function (data) {
				that.playUrl = eval('(' + data + ')').playUrl;
				resolve(that.playUrl);
			}).fail(reject)
		})
	}
	this.getPlayUrlByCode = function (_code) {
		var url = _path + "datajsp/play_getVodPlayUrl.jsp?mediaCode=" + _code;
		return new Promise(function (resolve, reject) {
			$.get(url, function (data) {
				that.playUrl = eval('(' + data + ')').playUrl;
				resolve(that.playUrl);
			}).fail(reject)
		})
	}
	this.getTvodPlayUrlById = function (_progid, _channelid) {
		var url = _path + "datajsp/play_getTvodPlayUrl.jsp?PROGID=" + _progid + "&CHANNELID=" + _channelid;
		return new Promise(function (resolve, reject) {
			$.get(url, function (data) {
				that.playUrl = eval('(' + data + ')').playUrl;
				resolve(that.playUrl);
			}).fail(reject)
		})
	}
}